/**
 * @param {number[]} nums
 * @return {number}
 */
var findMin = function(nums) {
  let result = nums[0];
  for(let i = 1; i < nums.length; i++) {
    if(result > nums[i]) result = nums[i];
  }
  return result;
};
let nums = [3,4,5,1,2];
console.log(findMin(nums));
nums = [4,5,6,7,0,1,2];
console.log(findMin(nums));
nums = [11,13,15,17];
console.log(findMin(nums));
